package com.atguigu.product.controller;

import com.atguigu.param.ProductSaveParam;
import com.atguigu.product.service.ProductService;
import com.atguigu.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName:ProductAdminController
 * Package:com.atguigu.product.controller
 * Description:
 *
 * @Author 应永豪
 * @Create 2024/4/23 14:50
 * @Version 1.0
 */
@RestController
@RequestMapping("product")
public class ProductAdminController {
    @Autowired
    private ProductService productService;

    @PostMapping("/admin/count")
    private Long adminCount(@RequestBody Integer categoryId) {
        return productService.adminCount(categoryId);

    }

    @PostMapping("/admin/save")
    private R adminSave(@RequestBody ProductSaveParam param) {
        return productService.adminSave(param);

    }
}
